<%--
  Created by IntelliJ IDEA.
  User: hanfei
  Date: 18/7/25
  Time: 下午2:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page import="com.wuming.house.security.SecurityHander" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>关于我们</title>
    <link rel="stylesheet" href="${allServerPath}static/layui/layui/css/layui.css">
    <link rel="stylesheet" href="${allServerPath}static/layui/css/icon.css">
    <link rel="stylesheet" href="${allServerPath}static/layui/css/public.css">
</head>
<body style="background-color: #f0f2f5;" class="childrenBody">
<div class="layui-fluid wuli-main">
    <div class="layui-row">
        <table class="layui-hide" id="reportInfo" lay-data="{height: 'full-200'}" lay-filter="reportinfo"></table>
        <!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
    </div>
</div>

<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">编辑</a>
</script>

<script src="${allServerPath}static/layui/layui/layui.js"></script>
<script>
    layui.use(['form', 'table'], function () {
        var table = layui.table,
            layer = layui.layer,
            $ = layui.$;

        //监听工具条
        table.on('tool(reportinfo)', function (obj) {
            var data = obj.data;
            if (obj.event === 'detail') {
                layer.open({
                    type: 2,
                    title: '编辑',
                    maxmin: true,
                    shadeClose: true, //点击遮罩关闭层
                    area: ['500px', '525px'],
                    content: '${allServerPath}web/aboutus/toEditAboutus/' + data.id + '.htmls',
                    end: function () {
                        table.reload('reportContent', {});
                    }
                });
            }
        });

        table.render({
            elem: '#reportInfo'
            , url: '${allServerPath}web/aboutus/list.htmls?t=' + Date.parse(new Date())
            , cols: [[
                {type: 'checkbox'}
                , {field: 'id', width: 80, align: 'center', title: 'ID'}
                , {field: 'name', width: 150, align: 'center', title: '名称'}
                , {field: 'toUrl', width: 180, align: 'center', title: '跳转地址'}
                , {fixed: 'right', title: '操作', width: 200, align: 'center', toolbar: '#barDemo'}
            ]],
            id: 'reportContent',
            method: 'get', //如果无需自定义HTTP类型，可不加该参数
            page: true,
            request: {
                pageName: 'pageIndex', //页码的参数名称，默认：page
                limitName: 'pageSize'
            }, //如果无需自定义请求参数，可不加该参数
            response: {
                statusName: 'code' //数据状态的字段名称，默认：code
                , statusCode: 200 //成功的状态码，默认：0
                , msgName: 'message' //状态信息的字段名称，默认：msg
                , countName: 'total' //数据总数的字段名称，默认：count
                , dataName: 'data' //数据列表的字段名称，默认：data
            }, //如果无需自定义数据响应名称，可不加该参数
            done: function (res, curr, count) {
                //如果是异步请求数据方式，res即为你接口返回的信息。
                //如果是直接赋值的方式，res即为：{data: [], count: 99} data为当前页数据、count为数据总长度
                console.log(res);

                //得到当前页码
                console.log(curr);

                //得到数据总量
                console.log(count);
            },
            text: {
                none: '暂无相关数据' //默认：无数据。注：该属性为 layui 2.2.5 开始新增
            }
        });

    });
</script>
</body>
</html>

